﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<%@ Import Namespace="OptimumInfra.Models" %>
<%@ Import Namespace="OptimumInfra.ViewData" %>
<%@ Import Namespace="System.Collections.Generic" %>
<asp:Content ID="Content2" ContentPlaceHolderID="AdminContent" runat="server">
<% 
    if (ViewData["orders"] != null)
    {
 %>
  <table width="700px" style="margin-top: 10px;">
  <tr>
     <th>--</th>  
     <th>Id</th>
     <th>Customer</th>
      <th>Date Created</th>
     <th>View</th>
    
  </tr>
    <%
    foreach (var order in (ViewData["orders"] as IEnumerable<ViewDataOrder>))
    {
            %>           
               <tr>
                <td width="30px"><input type="checkbox" name="ids" id="ids<%=order.Id %>" value="<%=order.Id %>" onclick="isChecked(this.checked);" /></td>
                <td width="30px"><%=order.Id%></td>
                <td>
                 <%=Html.ActionLink(order.FirstName, "Edit", new { id = order.Id })%>
                 </td
                  <td>
                      <%=order.DateAdd%>
                 </td
                <td width="50px"><%=Html.ActionLink("View", "Details", new { id = order.Id })%></td>
               </tr> 
            <%
    }  
         %>
     </table>
     <input type="hidden" name="ids" />
 <%
    }
    else
    {
        %>
        There is no order!
    <%
    } 
 %>
</asp:Content>
